<script type="text/javascript">
$(function(){
	 $.get("applicationSingle/getCardInfo",function(item){
		var contentb="<option value=''>请选择</option>";
		var contenta="<option value=''>请选择</option>";
		if(item.cdPhysicsTypes!=null&&item.cdProDefinitions!=null){
			for(i=0;i<item.cdPhysicsTypes.length;i++){
				contenta+="<option value="+item.cdPhysicsTypes[i].cardTypeCode+">"
				+item.cdPhysicsTypes[i].cardTypeName+"</option>"	
			}
			 for(i=0;i<item.cdProDefinitions.length;i++){
				 if(item.cdProDefinitions[i].cardpCode=="80"||item.cdProDefinitions[i].cardpCode=="17"){
					 contentb+="<option value="+item.cdProDefinitions[i].cardpCode+">"
					 +item.cdProDefinitions[i].cardpName+"</option>"	
				 }
						
			} 
		}
		$("#cardPCodeByAutonomyCenerateNo").html(contentb);
		$("#cardPhysicalTypeByAutonomyCenerateNo").html(contenta);
	},"json"); 
});
 function generateCardNumber(){
	var cardPCode=$("#cardPCodeByAutonomyCenerateNo").val();
	var cardPhysicalType=$("#cardPhysicalTypeByAutonomyCenerateNo").val();
	var cardNoNUm=$("input[name='cardNoNUm']").val();
	if(cardPCode==""||cardPhysicalType==""){
		alertMsg.info('卡产品，卡物理类型不能为空');
		return false;
	}
	var regu = /^[1-9]{1}[0-9]{0,4}$/;
	if(!regu.test(cardNoNUm)){
		alertMsg.info('【生成数量】：请输入数字，且最多五位数！');
		return false;
	}
	if(cardPCode!=""&&cardPhysicalType!=""){
		$.post("generateCardNo/generateCardNumber",{cardPCode:cardPCode,cardPhysicalType:cardPhysicalType,cardNoNUm:cardNoNUm},function(json){
			if(json.statusCode==DWZ.statusCode.error){
				navTabAjaxDone(json);
			}else if(json.statusCode==DWZ.statusCode.ok){
				alertMsg.correct("卡号生成成功,路径\n"+json.message)
				navTab.reloadFlag("autonomyGenerateCardNo")
				$.pdialog.closeCurrent();
			}
		},"json");
	}
	return false; 
}
</script>
<div class="pageContent">
	<form method="post" action="" class="pageForm required-validate" onsubmit="return formSubmit(this);">
		<div class="pageFormContent" layoutH="56">
			
			<p>
				<label>卡产品：</label>				
				<select id="cardPCodeByAutonomyCenerateNo" name="cardPCode" class="validRequired">
				
				</select>
			</P>
			<p>
				<label>卡物理类型：</label>
				<select id="cardPhysicalTypeByAutonomyCenerateNo" name="cardPhysicalType" class="validRequired">
				
				</select>
			</P>
			<p>
				<label>生成数量：</label>
				<!-- 没有什么作用的补丁不要打 -->
				<input name="cardNoNUm" class="validRequired">
			</P>
			 <a class="button"  href="#" onclick="return generateCardNumber();" ><span>生成卡号</span></a><br /><br />
			 </div>
	</form>
</div>